/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dmcn.bl.genetics.fitnessfunction;

import dmcn.bl.genetics.input.Input;
import java.util.Iterator;
import java.util.Random;
import org.jgap.*;

/**
 *
 * @author Spyros
 */
public class TerminalBulkFitnessFunction extends BulkFitnessFunction {

    private Input input;

    public TerminalBulkFitnessFunction(Input input) {
        this.input = input;
    }

    @Override
    public void evaluate(Population a_chromosomes) {
        for (Iterator it = a_chromosomes.iterator(); it.hasNext();) {
            Chromosome chromosome = (Chromosome) it.next();
            Evaluator evaluator = new Evaluator(input);
            Double fitness = evaluator.evaluate(chromosome);
            if (fitness != null) {
                chromosome.setFitnessValue(fitness);
            }
        }
    }

   
}
